package com.gujia.concurrency.example.singleton;

import com.gujia.concurrency.annoations.ThreadSafe;

/**
 * 饿汉模式
 * 单例实例在类装载使用时进行创建
 * 如果构造方法中存在过多的处理，类初始化时会比较慢
 */
@ThreadSafe
public class SingletonExample6 {


    private SingletonExample6(){

    }

    private static SingletonExample6 instance = null;

    static {
         instance = new SingletonExample6();
     }


    public static SingletonExample6 getInnstance(){
        return instance;
    }


}
